<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>v-model结合select类型</title>
</head>
<body>
<div id="app">
  <!--1、选择单个-->
  水果：
  <select name="fruit" id="fruit" v-model="fruit" style="width: 100px">
    <option value="">请选择</option>
    <option value="苹果">苹果</option>
    <option value="香蕉">香蕉</option>
    <option value="油桃">油桃</option>
    <option value="李子">李子</option>
  </select>
  <h2>您选择的水果是：{{fruit}}</h2>

  <hr>

  <!--2、选择多个-->
  水果：
  <select name="fruits" id="fruits" v-model="fruits" multiple style="width: 100px;">
    <option value="苹果">苹果</option>
    <option value="香蕉">香蕉</option>
    <option value="油桃">油桃</option>
    <option value="李子">李子</option>
  </select>
  <h2>您选择的水果有：{{fruits}}</h2>
</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      fruit: '',
      fruits: []
    }
  });
</script>
</body>
</html>
